package com.sh.rpc.registry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * SH_RPC注册中心
 * @author sh
 */
public class LocalRegistry {

    /**
     * 注册信息存储
     */
    private static  final Map<String, Class<?> > map = new ConcurrentHashMap<>();

    /**
     * 注册
     */
    public static void register(String serviceName, Class<?> implClass){
        map.put(serviceName, implClass);
    }

    /**
     * 获取
     */
    public static Class<?> get(String serviceName){
        return map.get(serviceName);
    }

    /**
     * 删除服务
     */
    public static void remover(String serviceName){
        map.remove(serviceName);
    }



}
